﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ICSharpCode.TextEditor.Document;

namespace SysSUFront
{
    public partial class VirtualTupleControl : UserControl
    {
        private const string RESTRICTION_DEFAULT = "function aggregate(tuple, virtual) {\r\n\r\n}";
        private const string TUPLE_DEFAULT = "{}";

        public VirtualTupleControl()
        {
            InitializeComponent();
        }

        private void AggregationControl_Load(object sender, EventArgs e)
        {
            tbxPattern.Document.HighlightingStrategy =
                HighlightingStrategyFactory.CreateHighlightingStrategy("JavaScript");
            tbxAggregation.Document.HighlightingStrategy =
               HighlightingStrategyFactory.CreateHighlightingStrategy("JavaScript");
            tbxFunction.Document.HighlightingStrategy =
               HighlightingStrategyFactory.CreateHighlightingStrategy("JavaScript");

            Clear();
        }

        public void Clear()
        {
            tbxPattern.Text = TUPLE_DEFAULT;
            tbxAggregation.Text = TUPLE_DEFAULT;
            tbxFunction.Text = RESTRICTION_DEFAULT;
        }
    }
}
